<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>

<base href="<%=basePath%>">
		<title>My JSP 'write_Article.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<script type="text/javascript" src="${pageContext.request.contextPath}/ckeditor/ckeditor.js"></script>
	</head>

	<body>
		<h1>
			编辑博客
			
		</h1>
		<br />
		<form name="articleForm" method="post"
			action="${pageContext.request.contextPath}/admin/blogs/${curArticle.id }">
			<table>
				<tr>
					<td width="57">
						主题：
					</td>
					<td width="146">
						<select name="origin">
							<c:forEach items="${origins}" var="org">
								<c:choose>
									<c:when test="${curArticle.originId==org.id}">
										<option value="${org.id }" selected="selected">
											${org.name }
										</option>
									</c:when>
									<c:otherwise>
										<option value="${org.id }">
											${org.name }
										</option>
									</c:otherwise>
								</c:choose>

							</c:forEach>
						</select>
					</td>
					<td width="535">
						<input type="text" name="title" value="${curArticle.title}"
							style="width: 400px;" />

					</td>
				</tr>
				<tr>
					<td>
						分类：
					</td>
					<td>
						<select name="category">
							<c:forEach items="${categories}" var="catg">
								<c:choose>
									<c:when test="${curArticle.category.id==catg.id}">
										<option value="${catg.id }" selected="selected">
											${catg.name }
										</option>
									</c:when>
									<c:otherwise>
										<option value="${catg.id }">
											${catg.name }
										</option>
									</c:otherwise>
								</c:choose>
							</c:forEach>
						</select>
					</td>
					<td>
						<input type="text" name="keyWords" value="${curArticle.keyWords}"
							style="width: 250px;">


					</td>

				</tr>
				<tr>
					<td colspan="3">
						<textarea name="content" cols="80" rows="20" id="editor1">
						${curArticle.content }
							</textarea>
						<script type="text/javascript">
								CKEDITOR.replace('editor1');
							</script>

						<p>
							<input type="submit" value="保存" />
							<input type="reset" value="清空" />
							<input type="hidden" name="method" value="updateBlog" />

						</p>

					</td>
				</tr>
			</table>
		</form>
	</body>
</html>
